Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×

?{Chose|Choice} thingy with macros?

?{Spells|Spell1,#spell1|Spell2,#spell2} i set up some macros for some spells, i added a button when clicked it will list the spells that person has, he'll chose which one he wants to use and then macro will apply. But when i try this it types #spell1 in the chat and macro is not getting triggered. How can i fix this?
Make sure the macro is set to visible to the player or all.
 still not getting triggered. Am i typing the ?{} command wrong? its my first time trying that
1590248615
GiGs
Pro
Sheet Author
API Scripter
This is nearly always a html entity problem: do any of your spell1 or spell2 macros contain queries? An important thing to realise: when you have a macro call in a macro, you migh texpect that roll20 goes line by line, does and the macro when it reaches it. But thats not what happens. Roll20 examines the entire macro, and grabs the contents of any macros mentioned, and puts them in the calling macro. So imaging spell1 and spell2 each contained, the following macro: I cast a spell, it does ?{Number of Dice|1}d6 damage Roll20 will start the top macro, grab the contents of sopell1 and spell2, resulting in this ?{Spells| Spell1,I cast a spell, it does ?{Number of Dice|1}d6 damage| Spell2,I cast a spell, it does ?{Number of Dice|1}d6 damage} and will then try to run that. The problem is, this macro ?{Number of Dice|1} contains special characters, | } that cause the macro to end prematurely. Roll20 has no way of knowing those are different queries. Nesting queries is very hard in roll20, see here:&nbsp; <a href="https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries" rel="nofollow">https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries</a> The best way to avoid this, is to replace your initial query with a chat menu:&nbsp; <a href="https://app.roll20.net/forum/permalink/5927072/" rel="nofollow">https://app.roll20.net/forum/permalink/5927072/</a> That way you dont have to edit the spell1 and spell2 macros.
GiGs said: This is nearly always a html entity problem: do any of your spell1 or spell2 macros contain queries? An important thing to realise: when you have a macro call in a macro, you migh texpect that roll20 goes line by line, does and the macro when it reaches it. But thats not what happens. Roll20 examines the entire macro, and grabs the contents of any macros mentioned, and puts them in the calling macro. So imaging spell1 and spell2 each contained, the following macro: I cast a spell, it does ?{Number of Dice|1}d6 damage Roll20 will start the top macro, grab the contents of sopell1 and spell2, resulting in this ?{Spells| Spell1,I cast a spell, it does ?{Number of Dice|1}d6 damage| Spell2,I cast a spell, it does ?{Number of Dice|1}d6 damage} and will then try to run that. The problem is, this macro ?{Number of Dice|1} contains special characters, | } that cause the macro to end prematurely. Roll20 has no way of knowing those are different queries. Nesting queries is very hard in roll20, see here:&nbsp; <a href="https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries" rel="nofollow">https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries</a> The best way to avoid this, is to replace your initial query with a chat menu:&nbsp; <a href="https://app.roll20.net/forum/permalink/5927072/" rel="nofollow">https://app.roll20.net/forum/permalink/5927072/</a> That way you dont have to edit the spell1 and spell2 macros. Okay i understand what the problem is now. I'll try the chat menu now thanks!